﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zj.HttpCodeDemo.ConsoleApp.CodeFirst.Core;

namespace Zj.HttpCodeDemo.ConsoleApp.CodeFirst
{
    /// <summary>
    /// EntityFramework db context.
    /// </summary>
    public class CodeFirstTestDbContext
        :DbContext
    {
        public CodeFirstTestDbContext()
            :base("name=CodeFirstTestDbContext")
        {
            Database.Log += log => Console.WriteLine(log);//Output log to console.
        }

        public virtual DbSet<User> User { get; set; }
        public virtual DbSet<UserLoginErrLog> UserLoginErrLog { get; set; }
    }
}
